package com.ruoyi.other.controller;

import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.other.domain.EExpressMachines;
import com.ruoyi.other.domain.EPackageTable;
import com.ruoyi.other.service.EExpressMachinesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.ruoyi.common.core.web.controller.BaseController.getDataTable;

@RestController
@RequestMapping("/machine")
public class EExpressMachinesController {
    @Autowired
    private EExpressMachinesService machinesService;

    @RequiresPermissions("other:machine:trend")
    @GetMapping("/trend")
    public TableDataInfo trend(String sf, Integer count) {
        // month参数表示要查询包裹列表的月份，nums参数表示其他相关的数量条件
        List<EExpressMachines> trendList=machinesService.selectTrendList(sf,count);
        // 将获取到的数据列表转换为适合返回给前端的TableDataInfo格式并返回
        return getDataTable(trendList);
    }
}
